package com.example.client.controller;

import com.example.nacos.api.DeregisterServiceProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeregisterServiceController {

    @Autowired
    private DeregisterServiceProxy deregisterInstance;

    @RequestMapping("/deregister")
    public String deregister(@RequestParam("status") String status) {
        try {
            deregisterInstance.deregister(status);
        } catch (Exception e) {
            System.out.println(e);
            return Boolean.FALSE.toString();
        }
        return Boolean.TRUE.toString();
    }

}
